<script setup lang="ts">
import { useRouter } from 'vue-router'

const value = ref<string>('');

const router = useRouter()

// 当前页面，点击搜索时跳转并传递搜索值
const onSearch = (searchValue: string) => {
  console.log('use value', searchValue);
  console.log('or use this.value', value.value);
  router.push({ path: '/search', query: { query: searchValue } })
};

</script>

<template>
    <a-space direction="vertical">
          <a-input-search ref="inputRef" v-model:value="value" placeholder="输入搜索关键词" style="width: 100%"
            @search="onSearch" />
        </a-space>
</template>
